import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/Home'
  },
  {
    path: '/Home',
    name: 'Home',
    component: Home
  },
  {
    path: '/List',
    name: 'List',
    component: () => import('../views/List.vue'),
    children: [
      {
        path: '/Listitem',
        name: 'Listitem',
        component: () => import('../views/list/Listitem.vue'),
      }
    ]
  },
  {
    path: '/My',
    name: 'My',
    component: () => import('../views/My.vue')
  },
  {
    path: '/Shopcar',
    name: 'Shopcar',
    component: () => import('../views/Shopcar.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
